package com.xuce.adminService.controller;

import com.xuce.adminService.service.AdminService;
import com.xuce.pojo.TUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 徐策
 * @date 2020/3/15 15:29
 */
@RestController
@Scope("prototype")
public class AdminController {

    @Resource
    AdminService adminService;

    //登录方法
    @PostMapping("/adminLogin")
    public TUser AdminLogin(@RequestBody TUser tUser){
//        return adminService.getOne(new QueryWrapper<TUser>()
//                .eq("username",tUser.getUname())
//                .eq("password",tUser.getPassword())
//                .eq("del",0));
        return adminService.findOneLoginUser(tUser);
    }

}
